package com.gome.test.api.bds;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DubboInit {

    private static ApplicationContext context;

    public static void beforeInit() {
        context = new ClassPathXmlApplicationContext("classpath:/dubbo-consumer.xml");

        if (context == null) {
            throw new IllegalArgumentException("spring init exception");
        }
    }

    public static Object getBean(String beanName) {
        return context.getBean(beanName);
    }
}
